package com.situ.domain;

import java.io.Serializable;

public class Student implements Serializable{
	/** serialVersionUID*/  
    private static final long serialVersionUID = 1123251L;
    
    private int id;
	private String name;
	private int age;
	private int sex;
	private Major major = new Major();

	@Override
	public String toString() {
		if (major != null) {
			return "id=" + id + "\tname=" + name + "\tage=" + age + "\tsex=" + sex + "\t" + major.toString();
		} else {
			return "id=" + id + "\tname=" + name + "\tage=" + age + "\tsex=" + sex;
		}
	}

	// 构造器
	public Student() {
		super();
	}

	public Student(int id, String name, int age, int sex) {
		super();
		this.id = id;
		this.name = name;
		this.age = age;
		this.sex = sex;
	}

	public Student(int id, String name, int age, int sex, Major major) {
		super();
		this.id = id;
		this.name = name;
		this.age = age;
		this.sex = sex;
		this.major = major;
	}

	// getter setter
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public int getSex() {
		return sex;
	}

	public void setSex(int sex) {
		this.sex = sex;
	}

	public Major getMajor() {
		return major;
	}

	public void setMajor(Major major) {
		this.major = major;
	}

}
